package com.example.androidbighomework;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ListView;

import androidx.appcompat.app.AppCompatActivity;

import com.example.androidbighomework.SQLiteHelper.MyHelper;
import com.example.androidbighomework.adapter.dongtaiBaseAdapter;

public class DongtaiActivity extends AppCompatActivity {
    public static final int ACCOUNTID=0;

    public Integer getAccountId() {
        return AccountId;
    }

    public void setAccountId(Integer accountId) {
        AccountId = accountId;
    }

    public Integer AccountId=null;
    private ListView mListViewDongTai;

    public View view;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dongtai);

        Bundle bundle=getIntent().getExtras();
        if(bundle!=null){
            Integer account1=bundle.getInt(String.valueOf(ACCOUNTID));
            setAccountId(account1);
        }

        initView();

        if(getAccountId()!=null){
            MyHelper myHelper=new MyHelper(getBaseContext());
            myHelper.findAccountDreamContent(getAccountId());
            Log.i("sdsdgsdg", String.valueOf(getAccountId()));
        }
        dongtaiBaseAdapter adapter=new dongtaiBaseAdapter();
        mListViewDongTai.setAdapter(adapter);

    }

    private void initView() {
        mListViewDongTai= findViewById(R.id.list_view_dongtai);
    }
}